import { useState } from "react";

export default function globaldrawer() {
    const [drawerVisible, setDrawerVisible] = useState(false);
    const [drawerTitle, setDrawerTitle] = useState(null);
    const [drawerWidth, setDrawerWidth] = useState(650);
    const [drawerHeight, setDrawerHeight] = useState(256);
    const [drawerComponent, setDrawerComponent] = useState(null);
    const [drawerPlacement, setDrawerPlacement] = useState("right");
    const [drawerFooter, setDrawerFooter] = useState(null);
    const [drawerContainer, setDrawerContainer] = useState(false);
    const [drawerClosable, setDrawerClosable] = useState(true);
    const [drawerMask, setDrawerMask] = useState(true);
    const [drawerMaskClosable, setDrawerMaskClosable] = useState(true);

    const onCloseGlobaldrawer = () => {
        setDrawerVisible(false);
        setDrawerTitle(null);
        setDrawerComponent(null);
    };

    return {
        drawerVisible,
        drawerTitle,
        drawerWidth,
        drawerHeight,
        drawerComponent,
        drawerPlacement,
        drawerFooter,
        drawerContainer,
        drawerClosable,
        drawerMask,
        drawerMaskClosable,
        setDrawerVisible,
        setDrawerTitle,
        setDrawerWidth,
        setDrawerHeight,
        setDrawerComponent,
        setDrawerPlacement,
        setDrawerFooter,
        onCloseGlobaldrawer,
        setDrawerContainer,
        setDrawerClosable,
        setDrawerMask,
        setDrawerMaskClosable,
    };
}
